using UnityEngine;

namespace NodeCanvas.DialogueTrees
{
	[AddComponentMenu("")]
	[Name("✫ Say")]
	[Description("Make the selected Dialogue Actor to talk")]
	public class DLGStatementNode : DLGNodeBase
	{
		public Statement statement = new Statement("This is a dialogue text");

		public override string nodeName
		{
			get
			{
				return base.nodeName + " " + base.finalActorName;
			}
		}

		protected override Status OnExecute()
		{
			if (!base.finalActor)
			{
				base.DLGTree.StopGraph();
				return Error("Actor not found");
			}
			base.DLGTree.currentNode = this;
			Statement statement = this.statement.BlackboardReplace(base.finalBlackboard);
			base.finalActor.Say(statement, base.Continue);
			return Status.Running;
		}
	}
}
